package com.wmtiger.component
{
	import com.wmtiger.component.base.WMSprite;
	import com.wmtiger.component.base.WMTextField;
	
	public class WMLabel extends WMSprite
	{
		private var _txt:String = "";
		private var _tf:WMTextField;
		private var _bg:WMSprite;//label的底板
		
		public function WMLabel(txt:String = "")
		{
			super();
			_txt = txt;
			initView();
		}
		
		private function initView():void
		{
			_tf = new WMTextField();
			_tf.text = _txt;
			addChild(_tf);
		}
		
		public function set label(value:String):void
		{
			_tf.text = "" + value;
		}
		
		public function get label():String
		{
			return _tf.text;
		}
		
		public function set selectable(value:Boolean):void
		{
			this.mouseChildren = value;
		}
		
		public function set bg(type:String):void
		{
			
		}
		
		override public function dispose():void
		{
			if (_tf)
			{
				_tf.filters = null;
				_tf = null;
			}
			if (_bg)
			{
				_bg = null;
			}
		}
	}
}